<!DOCTYPE html>
<html>
  <head>
    <title>addServer</title>
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="this is my page">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
   <!--  <script type="text/javascript" src="http://yez_easy.gitee.io/zt_data_monitor/zt_data_monitor/webapp/js/util/FrameOption.js"></script> -->
   	<script type="text/javascript" src="../../js/util/FrameOption.js"></script>
   	<link rel="stylesheet" href="../../layui/css/layui.css" type="text/css"></link>
   	<link rel="stylesheet" href="../../css/util/page_head_main.css" type="text/css"></link>
   	
   	<script type="text/javascript" src="../../js/util/jquery.js"></script>
	<script type="text/javascript" src="../../layui/layui.all.js"></script>
	<script type="text/javascript" src="../../js/util/arttemplate.js"></script>
	<script type="text/javascript" src="../../js/util/page_head_main.js"></script>
	<script type="text/javascript" src="../../js/data/manager/province-data.js"></script>
  	<style type="text/css">
		.div-button-three{
			width: 300px;
			height: 30px;
			border-left: 0px;
			border-top: 0px;
			border-right: 0px;
			border-bottom: 0px;
			 width: 95%;
		}
		.span-svn{
			margin-left: 10px;
			 float: left;
			 width: 140px;
		}
		.div-button-one{
			  width: 100px;
		    height: 30px;
		    border-left: 0px;
		    border-top: 0px;
		    border-right: 0px;
		    border-bottom-color: #93D1FF;
		    text-align: center;
		}
		.div-button-four{
			width: 60px;
	    height: 25px;
	    border-left: 0px;
	    border-top: 0px;
	    border-right: 0px;
	    text-align: center;
	    background-color: #93D1FF;
	    border-bottom: 0px;
	    border-radius: 25px;
	    cursor: pointer;
			
		}
  	</style>
  </head>
  
  <body>
   <div style="width: 100%;float: left;">
		<div class="row-div-mian" id="headDiv"></div>
 	</div>
 	<div style="float: left;height: 730px;overflow: auto;width: 100%;">
 			<div style="float: left;margin-left: 30px; width: 98%;margin-top: 10px;">
 						<div class="layui-inline">
				      <label class="layui-form-label">条件：</label>
				      <div class="layui-input-inline">
				        <input type="text" value="2018-06-01" name="date" id="date" lay-verify="date" placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input" lay-key="1">
				      </div>
				      <div class="layui-input-inline">
				       <input type="text" value="2018-08-01"  name="date1" id="date1" lay-verify="date" placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input" lay-key="1">
				      </div>
				      <div class="layui-input-inline">
				      	<input value="0" name="" id="startVersion" class="div-button-one">
				      </div>
				      <div class="layui-input-inline">
				      	<input value="-1" name="" id="endVersion" class="div-button-one">
				      </div>
 						</div>
 					 	<div class="layui-inline">
 					 			<i class="layui-icon layui-icon-search" style="font-size: 24px;" onclick="seachSvnInfo()"></i>
 					 	</div>
     	</div>
     	<div style="float: left;overflow: auto; width: 98%;margin-left: 30px;overflow-x: auto;" id="showPageInterface">
     		
     		
     	</div>
     	<div id="addInterface" style="display: none;">
     		<div style="margin-left: 30px;margin-top: 30px;">
				  <div class="layui-input-inline">
				  		<select id="interfaceName" style="width: 300px;height: 30px;border-left:0px ;border-bottom: 0px;border-right: 0px;">
				  			 
				  		</select>
				  </div>
		 	 			<div class="layui-input-inline">
	  			 		<input id="interfaceIndex" name="interfaceIndex"  type="text" value=""  placeholder="排序" class="div-button-one" style="width: 50px;"/>
	  			 </div>
	  			<div class="layui-input-inline">
	  			 		<input id="execueInfo"  name="execueInfo" type="text" value=""  placeholder="执行描述" class="div-button-one" style="width: 280px;"/>
	  			</div>
	  				<div class="layui-input-inline">
	  						<button class="div-button-four" onclick="addInterface()">新增</button> 
	  				</div>
     			
     		</div>
		 </div>
		 <input type="hidden" id="pageInterfaceNameHidden"  />
 	</div>
 	 
     
  </body>
  <script type="text/html" id="templateHead">
			<span >
				 <a href="javascript:void(0)" onclick="clickServers()" style="color: #999!important;">接口组</a>-
				 <a href="#" > <$=data$></a>
				 <a href="" style="margin-left: 5px;">
				  	<i class="layui-icon layui-anim layui-anim-rotate ">ဂ</i>
				 </a> 
			</span>
	</script>
	  <script type="text/html" id="templateSyc">
	  	
	  		<$for(var i=0;i<data.length;i++){$>
	  			<div style="margin-left: 30px;margin-top: 30px;"  >
						<div  class="layui-inline">
							<$=data[i].pageIndex$>
						</div>
							<div  class="layui-inline" style="margin-left: 20px;">
							<$=data[i].infoBeanName$>
						</div>
							<div  class="layui-inline" style="margin-left: 20px;">
							<$=data[i].pageName$>
						</div>
							<div  class="layui-inline" style="margin-left: 20px;">
							<$=data[i].pageInfo$>
						</div>
						<div  class="layui-inline" style="margin-left: 20px;">
							<i class="layui-icon layui-icon-tree" style="cursor:pointer;" onclick="ShowaddInterface('<$=data[i].infoBeanName$>')"></i>
						</div>
					</div>
					<$for(var k=0;k<data[i].infos.length;k++){$>
					<div style="margin-left: 60px;margin-top: 30px;"  >
							<div  class="layui-inline" style="margin-left: 20px;">
								<$=data[i].infos[k].interfaceIndex$>
							</div>
							<div  class="layui-inline" style="margin-left: 20px;">
							<a href="javascript:(0)" style="color: blue;">	<$=data[i].infos[k].inteName$> </a>
							</div>
							<div  class="layui-inline" style="margin-left: 20px;">
								<$=data[i].infos[k].execueInfo$>
							</div>

					</div>
					<$}$>
	  	<$}$>
	  		
	  
	  		<div style="margin-left: 30px;margin-top: 30px;" class="layui-inline">
	  			<div class="layui-input-inline">
	  			 		<input id="pageIndex"  type="text" value=""  placeholder="排序" class="layui-input div-button-one" style="width: 50px;"/>
	  			 </div>
	  			<div class="layui-input-inline">
	  					<input id="pageName"  type="text" value=""  placeholder="名称" class="layui-input div-button-one" style="width: 200px;"/>
				  </div>
	  			<div class="layui-input-inline">
	  			 		<input id="pageInfo"  type="text" value=""  placeholder="描述" class="layui-input div-button-one" style="width: 280px;"/>
	  			</div>
  				<div class="layui-input-inline">
  					<i class="layui-icon layui-icon-star" style="font-size: 22px;cursor:pointer;" onclick="addPageInterface()"></i>
  				</div>
	  		</div>
	  </script>
	  <script type="text/html" id="interfaceNameTemplate">
			<$for(var i=0;i<data.length;i++){$>
				<$for(var k=0;k<data[i].methods.length;k++){$>
					<option value="<$=data[i].url$><$=data[i].methods[k].url$>">	<$=data[i].url$><$=data[i].methods[k].url$> </option>
				<$}$>
	  	<$}$>
	  </script>
	<script type="text/javascript">
 		head({data:"接口管理"});	
 		 
 		
 		 var ipn="192.168.18.154";//"47.100.32.85"
 		 
 		function loadPageInterfacefo(){
 			var url="http://192.168.18.154:8080/yp-resource/interfacesGroupInfoCorntroller/queryPageInterfaces?";
 			
 			 	 	$.getJSON(url+"ypcollBack=?&saltEC=lgMxEb1UcEwBmHwSwQ9j8UviIOJdhD7MR9uygiFAs8o=",function(data,sucess){
 			 	 	var datas={
 			 	 		data:data.result
 			 	 	};
 			 	 	 	var html = template('templateSyc', datas);
 						$("#showPageInterface").html(html);
 			 	 	
 			 	 });
 			}
 		
 		function addPageInterface(){
 			var pageIndex=$("#pageIndex").val();
 			var pageName=$("#pageName").val();
 			var pageInfo=$("#pageInfo").val();
 				var url="http://192.168.18.154:8080/yp-resource/interfacesGroupInfoCorntroller/addInterfacesPage?";
 			 	 if(pageIndex!=""&&pageName!=""&&pageInfo!=""){
 			 	 	$.getJSON(url+"pageName="+pageName+"&pageIndex="+pageIndex+"&pageInfo="+pageInfo+"&ypcollBack=?&saltEC=lgMxEb1UcEwBmHwSwQ9j8UviIOJdhD7MR9uygiFAs8o=",function(data,sucess){
 			 	 	if(data==""||data==null){
 			 	 		 layAutolog("信息","没有加密参数和ypcollback")
 			 	 		}else{
 			 	 			layAutolog("信息",data.sucess);
 			 	 			loadPageInterfacefo();
 			 	 		}
 			 	 });
 			 	 }else{
 			 	 		layAutolog("信息","排序，名稱，描述不能爲空")
 			 	 }
 			 	 
 		}
 		
 		function ShowaddInterface(beanInfoName){
 			 $("#pageInterfaceNameHidden").val(beanInfoName);
 				layer.open({type:1,content:$('#addInterface').html(), area: ['70%', '70%'],title: ['接口添加', 'font-size:16px;']});
 				
 		}
 		 function layAutolog(title,content){
 		 	layer.open({
							  title: title
							  ,content: content
							});    
 		 }
 		 
 		 var ip1="192.168.18.154";
 		 function showInterfaceNameTemplate(){
 		 	
 		 	var url = "http://" + ip1 + ":8080/yp-resource/tomcatLogInfoController/getAllUrl";
			$.getJSON(url +  "?ypcollBack=?&saltEC=lgMxEb1UcEwBmHwSwQ9j8UviIOJdhD7MR9uygiFAs8o=", function(data, status) {
		  	var datas={
						 	data:data.scaUrl	 		
			 		 	};
			 	var html = template('interfaceNameTemplate', datas);
			 	$("#interfaceName").html(html);
			});
 		 }
 		 
 		function addInterface(){
 			
 			var urla= $("#interfaceName").val();
 			urla=urla.replace(/\//g,"~" );
 			var interfaceIndex=$("#interfaceIndex").val();
 			var execueInfo=$("#execueInfo").val();
 			var pageInterfaceName=$("#pageInterfaceNameHidden").val();
 		 var url="http://192.168.18.154:8080/yp-resource/interfacesGroupInfoCorntroller/addInterfacesInfo?";
 			 	 	$.getJSON(url+"pageInterfaceName="+pageInterfaceName+"&interfaceName="+urla+"&interfaceIndex="+interfaceIndex+"&execueInfo="+execueInfo+"&ypcollBack=?&saltEC=lgMxEb1UcEwBmHwSwQ9j8UviIOJdhD7MR9uygiFAs8o=",function(data,sucess){
 			 	 	if(data==""||data==null){
 			 	 		 layAutolog("信息","没有加密参数和ypcollback")
 			 	 		}else{
 			 	 			layAutolog("信息",data.sucess);
 			 	 		}
 			 	 		loadPageInterfacefo();
 			 	 });
 			
 		}
  function queryFileContext(urla){
  	urla=urla.replace(/\//g,"~" );
  	var url="http://"+ip+":8280/icy_sy_websit_manager/sVNController/queryFileLog.icy?";
 			 	 	$.getJSON(url+"endRevision="+endRevision+"&pathUrl="+urla+"&icyCallback=?",function(data,sucess){
 			 	 		console.log(data,sucess)
 			 	 		var objectVal={
 			 	 			data:data.result
 			 	 		};
 			 	 		 var html1 = template('templeteSvnFileContext', objectVal);
		 				document.getElementById("svnFileContext").innerHTML = html1;
			 			layer.open({type:1,content:$('#svnFileContext').html(), area: ['70%', '70%'],title: ['接口测试', 'font-size:16px;']});
 			 	 });
  }
 		
 		 loadPageInterfacefo();
 		 showInterfaceNameTemplate();
 		 
	</script>
</html>
